// src/api/jobApplication.js
import request from '@/utils/request';

// 获取管理员查看的所有申请
export const getAdminApplications = (params) => {
  return request({
    url: '/api/admin/job-applications',
    method: 'get',
    params
  });
};

// 审核申请
export const review = (id, data) => {
  return request({
    url: `/api/job-applications/review/${id}`, // 路径与后端路由一致
    method: 'put', // 方法改为PUT
    data,
    headers: {
      'admintoken': localStorage.getItem('adminToken') // 使用小写
    }
  });
};

// 获取申请详情
export const getApplicationDetail = (id) => {
  return request({
    url: `/api/job-applications/${id}`,
    method: 'get'
  });
};